import subprocess

def getCPULoad():
    """
    :return:
    """
    ret = runcmd("uptime")


def runcmd(command):
    """

    :param command: 所执行的命令
    :return: 命令执行的结果
    """
    ret = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8",
                         timeout=1)
    if ret.returncode == 0:
        return ret
    else:
        return

if __name__ == '__main__':
    getCPULoad()